<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>libcoap: mem.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">libcoap<span id="projectnumber">&#160;4.2.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.8 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('mem_8h.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>

<div class="header">
  <div class="summary">
<a href="#enum-members">Enumerations</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle"><div class="title">mem.h File Reference</div></div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &lt;stdlib.h&gt;</code><br />
</div>
<p><a href="mem_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="enum-members" name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:a703fa791ab7a14ff983df73b15e9c620" id="r_a703fa791ab7a14ff983df73b15e9c620"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mem_8h.html#a703fa791ab7a14ff983df73b15e9c620">coap_memory_tag_t</a> { <br />
&#160;&#160;<a class="el" href="mem_8h.html#a703fa791ab7a14ff983df73b15e9c620ac4b8bae3a94d882154fabe0957a3ab2e">COAP_STRING</a>
, <a class="el" href="mem_8h.html#a703fa791ab7a14ff983df73b15e9c620aa8a6d143ba39aca364b42f7c6bd4d618">COAP_ATTRIBUTE_NAME</a>
, <a class="el" href="mem_8h.html#a703fa791ab7a14ff983df73b15e9c620a4baef278cf60f00d15b149914c0f1811">COAP_ATTRIBUTE_VALUE</a>
, <a class="el" href="mem_8h.html#a703fa791ab7a14ff983df73b15e9c620ab4e8cb3171f267b830d97626ad7a8d69">COAP_PACKET</a>
, <br />
&#160;&#160;<a class="el" href="mem_8h.html#a703fa791ab7a14ff983df73b15e9c620a239e408c064f87c6e7cfa8b2d6442f9d">COAP_NODE</a>
, <a class="el" href="mem_8h.html#a703fa791ab7a14ff983df73b15e9c620a63028bf12af38811e0cb3ec7fe35e897">COAP_CONTEXT</a>
, <a class="el" href="mem_8h.html#a703fa791ab7a14ff983df73b15e9c620a58e4d720ad9177654baa457ab284510b">COAP_ENDPOINT</a>
, <a class="el" href="mem_8h.html#a703fa791ab7a14ff983df73b15e9c620a7442ae365f092f7aa0e516e6d67e7740">COAP_PDU</a>
, <br />
&#160;&#160;<a class="el" href="mem_8h.html#a703fa791ab7a14ff983df73b15e9c620ac7bb2f8183a3ed5a92a3e085b542f42f">COAP_PDU_BUF</a>
, <a class="el" href="mem_8h.html#a703fa791ab7a14ff983df73b15e9c620a3ed13177a838b75eb0c46d4f4dce85ac">COAP_RESOURCE</a>
, <a class="el" href="mem_8h.html#a703fa791ab7a14ff983df73b15e9c620a3ed3c7e549d893f00509f9e2f07249c0">COAP_RESOURCEATTR</a>
, <a class="el" href="mem_8h.html#a703fa791ab7a14ff983df73b15e9c620a010f82674bff4f905896c7ff94252ce4">COAP_SESSION</a>
, <br />
&#160;&#160;<a class="el" href="mem_8h.html#a703fa791ab7a14ff983df73b15e9c620a72ef666492d28949f05ecadef120d4e4">COAP_OPTLIST</a>
<br />
 }</td></tr>
<tr class="memdesc:a703fa791ab7a14ff983df73b15e9c620"><td class="mdescLeft">&#160;</td><td class="mdescRight">Type specifiers for <a class="el" href="mem_8h.html#a9f9fd8d6cf24f9c45a5501aeba5acaf9" title="Allocates a chunk of size bytes and returns a pointer to the newly allocated memory.">coap_malloc_type()</a>.  <a href="mem_8h.html#a703fa791ab7a14ff983df73b15e9c620">More...</a><br /></td></tr>
<tr class="separator:a703fa791ab7a14ff983df73b15e9c620"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a65d0fc0fe6cad555b56e92ccb57613ba" id="r_a65d0fc0fe6cad555b56e92ccb57613ba"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mem_8h.html#a65d0fc0fe6cad555b56e92ccb57613ba">coap_memory_init</a> (void)</td></tr>
<tr class="memdesc:a65d0fc0fe6cad555b56e92ccb57613ba"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initializes libcoap's memory management.  <br /></td></tr>
<tr class="separator:a65d0fc0fe6cad555b56e92ccb57613ba"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9f9fd8d6cf24f9c45a5501aeba5acaf9" id="r_a9f9fd8d6cf24f9c45a5501aeba5acaf9"><td class="memItemLeft" align="right" valign="top">void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mem_8h.html#a9f9fd8d6cf24f9c45a5501aeba5acaf9">coap_malloc_type</a> (<a class="el" href="mem_8h.html#a703fa791ab7a14ff983df73b15e9c620">coap_memory_tag_t</a> type, size_t size)</td></tr>
<tr class="memdesc:a9f9fd8d6cf24f9c45a5501aeba5acaf9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Allocates a chunk of <code>size</code> bytes and returns a pointer to the newly allocated memory.  <br /></td></tr>
<tr class="separator:a9f9fd8d6cf24f9c45a5501aeba5acaf9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae7214e0c73a4d4290525873e739ed422" id="r_ae7214e0c73a4d4290525873e739ed422"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mem_8h.html#ae7214e0c73a4d4290525873e739ed422">coap_free_type</a> (<a class="el" href="mem_8h.html#a703fa791ab7a14ff983df73b15e9c620">coap_memory_tag_t</a> type, void *p)</td></tr>
<tr class="memdesc:ae7214e0c73a4d4290525873e739ed422"><td class="mdescLeft">&#160;</td><td class="mdescRight">Releases the memory that was allocated by <a class="el" href="mem_8h.html#a9f9fd8d6cf24f9c45a5501aeba5acaf9" title="Allocates a chunk of size bytes and returns a pointer to the newly allocated memory.">coap_malloc_type()</a>.  <br /></td></tr>
<tr class="separator:ae7214e0c73a4d4290525873e739ed422"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a26f40acd710e6c964242c2e0cd789375" id="r_a26f40acd710e6c964242c2e0cd789375"><td class="memItemLeft" align="right" valign="top"><a class="el" href="libcoap_8h.html#a58b4446dccd0b8c21b3532ef6b77a57d">COAP_STATIC_INLINE</a> void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mem_8h.html#a26f40acd710e6c964242c2e0cd789375">coap_malloc</a> (size_t size)</td></tr>
<tr class="memdesc:a26f40acd710e6c964242c2e0cd789375"><td class="mdescLeft">&#160;</td><td class="mdescRight">Wrapper function to <a class="el" href="mem_8h.html#a9f9fd8d6cf24f9c45a5501aeba5acaf9" title="Allocates a chunk of size bytes and returns a pointer to the newly allocated memory.">coap_malloc_type()</a> for backwards compatibility.  <br /></td></tr>
<tr class="separator:a26f40acd710e6c964242c2e0cd789375"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1e46a1505bb13f03fdacd5d1b32502a6" id="r_a1e46a1505bb13f03fdacd5d1b32502a6"><td class="memItemLeft" align="right" valign="top"><a class="el" href="libcoap_8h.html#a58b4446dccd0b8c21b3532ef6b77a57d">COAP_STATIC_INLINE</a> void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mem_8h.html#a1e46a1505bb13f03fdacd5d1b32502a6">coap_free</a> (void *object)</td></tr>
<tr class="memdesc:a1e46a1505bb13f03fdacd5d1b32502a6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Wrapper function to <a class="el" href="mem_8h.html#ae7214e0c73a4d4290525873e739ed422" title="Releases the memory that was allocated by coap_malloc_type().">coap_free_type()</a> for backwards compatibility.  <br /></td></tr>
<tr class="separator:a1e46a1505bb13f03fdacd5d1b32502a6"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Enumeration Type Documentation</h2>
<a id="a703fa791ab7a14ff983df73b15e9c620" name="a703fa791ab7a14ff983df73b15e9c620"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a703fa791ab7a14ff983df73b15e9c620">&#9670;&#160;</a></span>coap_memory_tag_t</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="mem_8h.html#a703fa791ab7a14ff983df73b15e9c620">coap_memory_tag_t</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Type specifiers for <a class="el" href="mem_8h.html#a9f9fd8d6cf24f9c45a5501aeba5acaf9" title="Allocates a chunk of size bytes and returns a pointer to the newly allocated memory.">coap_malloc_type()</a>. </p>
<p>Memory objects can be typed to facilitate arrays of type objects to be used instead of dynamic memory management on constrained devices. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="a703fa791ab7a14ff983df73b15e9c620ac4b8bae3a94d882154fabe0957a3ab2e" name="a703fa791ab7a14ff983df73b15e9c620ac4b8bae3a94d882154fabe0957a3ab2e"></a>COAP_STRING&#160;</td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="a703fa791ab7a14ff983df73b15e9c620aa8a6d143ba39aca364b42f7c6bd4d618" name="a703fa791ab7a14ff983df73b15e9c620aa8a6d143ba39aca364b42f7c6bd4d618"></a>COAP_ATTRIBUTE_NAME&#160;</td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="a703fa791ab7a14ff983df73b15e9c620a4baef278cf60f00d15b149914c0f1811" name="a703fa791ab7a14ff983df73b15e9c620a4baef278cf60f00d15b149914c0f1811"></a>COAP_ATTRIBUTE_VALUE&#160;</td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="a703fa791ab7a14ff983df73b15e9c620ab4e8cb3171f267b830d97626ad7a8d69" name="a703fa791ab7a14ff983df73b15e9c620ab4e8cb3171f267b830d97626ad7a8d69"></a>COAP_PACKET&#160;</td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="a703fa791ab7a14ff983df73b15e9c620a239e408c064f87c6e7cfa8b2d6442f9d" name="a703fa791ab7a14ff983df73b15e9c620a239e408c064f87c6e7cfa8b2d6442f9d"></a>COAP_NODE&#160;</td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="a703fa791ab7a14ff983df73b15e9c620a63028bf12af38811e0cb3ec7fe35e897" name="a703fa791ab7a14ff983df73b15e9c620a63028bf12af38811e0cb3ec7fe35e897"></a>COAP_CONTEXT&#160;</td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="a703fa791ab7a14ff983df73b15e9c620a58e4d720ad9177654baa457ab284510b" name="a703fa791ab7a14ff983df73b15e9c620a58e4d720ad9177654baa457ab284510b"></a>COAP_ENDPOINT&#160;</td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="a703fa791ab7a14ff983df73b15e9c620a7442ae365f092f7aa0e516e6d67e7740" name="a703fa791ab7a14ff983df73b15e9c620a7442ae365f092f7aa0e516e6d67e7740"></a>COAP_PDU&#160;</td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="a703fa791ab7a14ff983df73b15e9c620ac7bb2f8183a3ed5a92a3e085b542f42f" name="a703fa791ab7a14ff983df73b15e9c620ac7bb2f8183a3ed5a92a3e085b542f42f"></a>COAP_PDU_BUF&#160;</td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="a703fa791ab7a14ff983df73b15e9c620a3ed13177a838b75eb0c46d4f4dce85ac" name="a703fa791ab7a14ff983df73b15e9c620a3ed13177a838b75eb0c46d4f4dce85ac"></a>COAP_RESOURCE&#160;</td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="a703fa791ab7a14ff983df73b15e9c620a3ed3c7e549d893f00509f9e2f07249c0" name="a703fa791ab7a14ff983df73b15e9c620a3ed3c7e549d893f00509f9e2f07249c0"></a>COAP_RESOURCEATTR&#160;</td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="a703fa791ab7a14ff983df73b15e9c620a010f82674bff4f905896c7ff94252ce4" name="a703fa791ab7a14ff983df73b15e9c620a010f82674bff4f905896c7ff94252ce4"></a>COAP_SESSION&#160;</td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="a703fa791ab7a14ff983df73b15e9c620a72ef666492d28949f05ecadef120d4e4" name="a703fa791ab7a14ff983df73b15e9c620a72ef666492d28949f05ecadef120d4e4"></a>COAP_OPTLIST&#160;</td><td class="fielddoc"></td></tr>
</table>

<p class="definition">Definition at line <a class="el" href="mem_8h_source.html#l00029">29</a> of file <a class="el" href="mem_8h_source.html">mem.h</a>.</p>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="a1e46a1505bb13f03fdacd5d1b32502a6" name="a1e46a1505bb13f03fdacd5d1b32502a6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1e46a1505bb13f03fdacd5d1b32502a6">&#9670;&#160;</a></span>coap_free()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="libcoap_8h.html#a58b4446dccd0b8c21b3532ef6b77a57d">COAP_STATIC_INLINE</a> void coap_free </td>
          <td>(</td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>object</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Wrapper function to <a class="el" href="mem_8h.html#ae7214e0c73a4d4290525873e739ed422" title="Releases the memory that was allocated by coap_malloc_type().">coap_free_type()</a> for backwards compatibility. </p>

<p class="definition">Definition at line <a class="el" href="mem_8h_source.html#l00082">82</a> of file <a class="el" href="mem_8h_source.html">mem.h</a>.</p>

</div>
</div>
<a id="ae7214e0c73a4d4290525873e739ed422" name="ae7214e0c73a4d4290525873e739ed422"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae7214e0c73a4d4290525873e739ed422">&#9670;&#160;</a></span>coap_free_type()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void coap_free_type </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="mem_8h.html#a703fa791ab7a14ff983df73b15e9c620">coap_memory_tag_t</a>&#160;</td>
          <td class="paramname"><em>type</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>p</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Releases the memory that was allocated by <a class="el" href="mem_8h.html#a9f9fd8d6cf24f9c45a5501aeba5acaf9" title="Allocates a chunk of size bytes and returns a pointer to the newly allocated memory.">coap_malloc_type()</a>. </p>
<p>The type tag <code>type</code> must be the same that was used for allocating the object pointed to by <code></code>.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">type</td><td>The type of the object to release. </td></tr>
    <tr><td class="paramname">p</td><td>A pointer to memory that was allocated by <a class="el" href="mem_8h.html#a9f9fd8d6cf24f9c45a5501aeba5acaf9" title="Allocates a chunk of size bytes and returns a pointer to the newly allocated memory.">coap_malloc_type()</a>. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a26f40acd710e6c964242c2e0cd789375" name="a26f40acd710e6c964242c2e0cd789375"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a26f40acd710e6c964242c2e0cd789375">&#9670;&#160;</a></span>coap_malloc()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="libcoap_8h.html#a58b4446dccd0b8c21b3532ef6b77a57d">COAP_STATIC_INLINE</a> void * coap_malloc </td>
          <td>(</td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>size</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Wrapper function to <a class="el" href="mem_8h.html#a9f9fd8d6cf24f9c45a5501aeba5acaf9" title="Allocates a chunk of size bytes and returns a pointer to the newly allocated memory.">coap_malloc_type()</a> for backwards compatibility. </p>

<p class="definition">Definition at line <a class="el" href="mem_8h_source.html#l00075">75</a> of file <a class="el" href="mem_8h_source.html">mem.h</a>.</p>

</div>
</div>
<a id="a9f9fd8d6cf24f9c45a5501aeba5acaf9" name="a9f9fd8d6cf24f9c45a5501aeba5acaf9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9f9fd8d6cf24f9c45a5501aeba5acaf9">&#9670;&#160;</a></span>coap_malloc_type()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void * coap_malloc_type </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="mem_8h.html#a703fa791ab7a14ff983df73b15e9c620">coap_memory_tag_t</a>&#160;</td>
          <td class="paramname"><em>type</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>size</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Allocates a chunk of <code>size</code> bytes and returns a pointer to the newly allocated memory. </p>
<p>The <code>type</code> is used to select the appropriate storage container on constrained devices. The storage allocated by <a class="el" href="mem_8h.html#a9f9fd8d6cf24f9c45a5501aeba5acaf9" title="Allocates a chunk of size bytes and returns a pointer to the newly allocated memory.">coap_malloc_type()</a> must be released with <a class="el" href="mem_8h.html#ae7214e0c73a4d4290525873e739ed422" title="Releases the memory that was allocated by coap_malloc_type().">coap_free_type()</a>.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">type</td><td>The type of object to be stored. </td></tr>
    <tr><td class="paramname">size</td><td>The number of bytes requested. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A pointer to the allocated storage or <code>NULL</code> on error. </dd></dl>

</div>
</div>
<a id="a65d0fc0fe6cad555b56e92ccb57613ba" name="a65d0fc0fe6cad555b56e92ccb57613ba"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a65d0fc0fe6cad555b56e92ccb57613ba">&#9670;&#160;</a></span>coap_memory_init()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void coap_memory_init </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Initializes libcoap's memory management. </p>
<p>This function must be called once before <a class="el" href="mem_8h.html#a26f40acd710e6c964242c2e0cd789375" title="Wrapper function to coap_malloc_type() for backwards compatibility.">coap_malloc()</a> can be used on constrained devices. </p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_a14d23a24002734ac2a3b997119f008e.html">coap2</a></li><li class="navelem"><a class="el" href="mem_8h.html">mem.h</a></li>
    <li class="footer">Generated on Fri Dec 27 2024 09:57:44 for libcoap by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.8 </li>
  </ul>
</div>
</body>
</html>
